Skip to content

Unify wording of resolve error #145399

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Aug 14, 2025

Remove "failed to resolve" from the main error message and use the same format we use in other resolution errors "cannot find name":

error[E0433]: cannot find `nonexistent` in `existent`
  --> $DIR/custom_attr_multisegment_error.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`

The intent behind this is to end up with all resolve errors eventually be on the form of

error[ECODE]: cannot find `{NAME}` in {SCOPE}
  --> $DIR/file.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ {SPECIFIC LABEL}

A category of errors that is interest are those that involve keywords. For example:

error[E0433]: cannot find `Self` in this scope
  --> $DIR/issue-97194.rs:2:35
   |
LL |     fn bget(&self, index: [usize; Self::DIM]) -> bool {
   |                                   ^^^^ `Self` is only available in impls, traits, and type definitions

and

error[E0433]: cannot find `super` in this scope
  --> $DIR/keyword-super.rs:2:9
   |
LL |     let super: isize;
   |         ^^^^^ there are too many leading `super` keywords

For these the label provides the actual help, while the message is less informative beyond telling you "couldn't find name".

This is an off-shoot of #126810 and #128086, a subset of the intended changes there with review comments applied.

r? @petrochenkov

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Aug 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Aug 14, 2025

This PR modifies tests/ui/issues/. If this PR is adding new tests to tests/ui/issues/,
please refrain from doing so, and instead add it to more descriptive subdirectories.

@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the resolve-error-wording-2 branch from fd49d2a to 298dec7 Compare August 14, 2025 16:32
@@ -1,4 +1,4 @@
error[E0433]: failed to resolve: partially resolved path in a macro
error[E0433]: cannot find `bar` in `Foo`
--> $DIR/extern-macro.rs:5:13
|
LL | let _ = Foo::bar!();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a diagnostic that needs improvement regardless: we need to explain that Foo is a type and that macros can't be in them. It would be particularly bad if Foo had an associated item bar as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the output to be

error[E0433]: cannot find macro `bar` in enum `Foo`
  --> $DIR/extern-macro.rs:5:13
   |
LL |     let _ = Foo::bar!();
   |             ^^^^^^^^ a macro can't exist within an enum

Not perfect, but I feel it's more informative than we used to be.

@@ -41,7 +41,7 @@ LL - bar: st::cell::Cell<bool>
LL + bar: cell::Cell<bool>
|

error[E0433]: failed to resolve: function `bar` is not a crate or module
error[E0433]: cannot find `bar` in this scope
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I found I'd opened a separate PR already with some of these changes, and you had a comment about this change in particular

#128086 (comment)

I agree that this isn't an improvement, but the primary label does still mention the intended issue. I'll see over the weekend what I can do about this.

@estebank estebank added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 14, 2025
@rust-log-analyzer

This comment has been minimized.

@petrochenkov petrochenkov removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 15, 2025
Remove "failed to resolve" and use the same format we use in other resolution errors "cannot find `name`".

```
error[E0433]: cannot find `nonexistent` in `existent`
  --> $DIR/custom_attr_multisegment_error.rs:5:13
   |
LL | #[existent::nonexistent]
   |             ^^^^^^^^^^^ could not find `nonexistent` in `existent`
```
@estebank estebank force-pushed the resolve-error-wording-2 branch from 298dec7 to 0b0bd12 Compare August 15, 2025 19:20
@estebank estebank force-pushed the resolve-error-wording-2 branch from 0b0bd12 to f6ce33d Compare August 15, 2025 19:28
Comment on lines +1 to +5
error[E0433]: cannot find derive macro `Anything` in trait `Foo`
--> $DIR/issue-46101.rs:2:10
|
LL | #[derive(Foo::Anything)]
| ^^^^^^^^^^^^^ partially resolved path in a derive macro
| ^^^^^^^^^^^^^ a derive macro can't exist within a trait
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if there's a wording you'd prefer for the label. I want to communicate the impossibility of the macro being in ADTs and traits in the first place.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-19-1 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
---- [ui] tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs stdout ----
Saved the actual stderr to `/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/diagnostic-derive/diagnostic-derive.stderr`
diff of stderr:

524    = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]`
525    = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`
526 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
528   --> $DIR/diagnostic-derive.rs:58:8
529    |
---
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
534   --> $DIR/diagnostic-derive.rs:802:23
535    |
536 LL |     #[suggestion(code(foo))]

537    |                       ^^^ you might be missing crate `core`
538 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
540   --> $DIR/diagnostic-derive.rs:811:25
541    |
542 LL |     #[suggestion(code = 3)]


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args session-diagnostic/diagnostic-derive.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/diagnostic-derive" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error: derive(Diagnostic): unsupported type attribute for diagnostic derive enum
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:47:1
   |
LL | #[diag(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:50:5
   |
LL |     Foo,
   |     ^^^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:52:5
   |
LL |     Bar,
   |     ^^^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): `#[nonsense(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:63:1
   |
LL | #[nonsense(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:63:1
   |
LL | #[nonsense(no_crate_example, code = E0123)]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:70:1
   |
LL | #[diag(code = E0123)]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): diagnostic slug must be the first argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:80:16
   |
LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
   |                ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:80:1
   |
LL | #[diag(nonsense("foo"), code = E0123, slug = "foo")]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): unknown argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:86:8
   |
LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
   |        ^^^^^^^^
   |
   = note: only the `code` parameter is valid after the slug

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:86:1
   |
LL | #[diag(nonsense = "...", code = E0123, slug = "foo")]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): unknown argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:92:8
   |
LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
   |        ^^^^^^^^
   |
   = note: only the `code` parameter is valid after the slug

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:92:1
   |
LL | #[diag(nonsense = 4, code = E0123, slug = "foo")]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): unknown argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:98:40
   |
LL | #[diag(no_crate_example, code = E0123, slug = "foo")]
   |                                        ^^^^
   |
   = note: only the `code` parameter is valid after the slug

error: derive(Diagnostic): `#[suggestion = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:105:5
   |
LL |     #[suggestion = "bar"]
   |     ^

---

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:118:40
   |
LL | #[diag(no_crate_example, code = E0123, code = E0456)]
   |                                        ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:118:26
   |
LL | #[diag(no_crate_example, code = E0123, code = E0456)]
   |                          ^^^^

error: derive(Diagnostic): diagnostic slug must be the first argument
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:123:43
   |
LL | #[diag(no_crate_example, no_crate::example, code = E0123)]
   |                                           ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:128:1
   |
LL | struct KindNotProvided {} //~ ERROR diagnostic slug not specified
   | ^^^^^^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:131:1
   |
LL | #[diag(code = E0123)]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:142:5
   |
LL |     #[primary_span]
   |     ^

error: derive(Diagnostic): `#[nonsense]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:150:5
   |
LL |     #[nonsense]
   |     ^

error: derive(Diagnostic): the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:167:5
   |
LL |     #[label(no_crate_label)]
   |     ^

error: derive(Diagnostic): `name` doesn't refer to a field on this type
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:175:46
   |
LL |     #[suggestion(no_crate_suggestion, code = "{name}")]
   |                                              ^^^^^^^^

error: invalid format string: expected `}` but string was terminated
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:180:10
   |
LL | #[derive(Diagnostic)]
   |          ^^^^^^^^^^ expected `}` in format string
   |
   = note: if you intended to print `{`, you can escape it using `{{`
   = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)

error: invalid format string: unmatched `}` found
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:190:10
   |
LL | #[derive(Diagnostic)]
   |          ^^^^^^^^^^ unmatched `}` in format string
   |
   = note: if you intended to print `}`, you can escape it using `}}`
   = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)

error: derive(Diagnostic): the `#[label(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:210:5
   |
LL |     #[label(no_crate_label)]
   |     ^

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:229:5
   |
LL |     #[suggestion(no_crate_suggestion)]
   |     ^

error: derive(Diagnostic): invalid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:237:18
   |
LL |     #[suggestion(nonsense = "bar")]
   |                  ^^^^^^^^
   |
   = help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:237:5
   |
LL |     #[suggestion(nonsense = "bar")]
   |     ^

error: derive(Diagnostic): invalid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:246:18
   |
LL |     #[suggestion(msg = "bar")]
   |                  ^^^
   |
   = help: only `no_span`, `style`, `code` and `applicability` are valid nested attributes

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:246:5
   |
LL |     #[suggestion(msg = "bar")]
   |     ^

error: derive(Diagnostic): wrong field type for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:269:5
   |
LL |     #[suggestion(no_crate_suggestion, code = "This is suggested code")]
   |     ^
   |
   = help: `#[suggestion(...)]` should be applied to fields of type `Span` or `(Span, Applicability)`

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:285:24
   |
LL |     suggestion: (Span, Span, Applicability),
---
   |
LL |     suggestion: (Applicability, Applicability, Span),
   |                  ^^^^^^^^^^^^^

error: derive(Diagnostic): `#[label = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:300:5
   |
LL |     #[label = "bar"]
   |     ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:451:5
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", applicability = "maybe-incorrect")]
   |     ^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:453:24
   |
LL |     suggestion: (Span, Applicability),
   |                        ^^^^^^^^^^^^^

error: derive(Diagnostic): invalid applicability
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:459:69
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", applicability = "batman")]
   |                                                                     ^^^^^^^^

error: derive(Diagnostic): the `#[help(...)]` attribute can only be applied to fields of type `Span`, `MultiSpan`, `bool` or `()`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:526:5
   |
LL |     #[help(no_crate_help)]
   |     ^

error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:535:32
   |
LL |     #[label(no_crate_label, foo)]
   |                                ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:543:29
   |
LL |     #[label(no_crate_label, foo = "...")]
   |                             ^^^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:551:29
   |
LL |     #[label(no_crate_label, foo("..."))]
   |                             ^^^

error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:563:5
   |
LL |     #[primary_span]
   |     ^
   |
   = help: the `primary_span` field attribute is not valid for lint diagnostics

error: derive(Diagnostic): `#[error(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:583:1
   |
LL | #[error(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:583:1
   |
LL | #[error(no_crate_example, code = E0123)]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): `#[warn_(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:590:1
   |
LL | #[warn_(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:590:1
   |
LL | #[warn_(no_crate_example, code = E0123)]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:597:1
   |
LL | #[lint(no_crate_example, code = E0123)]
   | ^

error: derive(Diagnostic): diagnostic slug not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:597:1
   |
LL | #[lint(no_crate_example, code = E0123)]
   | ^
   |
   = help: specify the slug as the first argument to the `#[diag(...)]` attribute, such as `#[diag(hir_analysis_example_error)]`

error: derive(Diagnostic): `#[lint(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:604:1
   |
LL | #[lint(no_crate_example, code = E0123)]
   | ^

---

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:613:53
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
   |                                                     ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:613:39
   |
LL |     #[suggestion(no_crate_suggestion, code = "...", code = ",,,")]
   |                                       ^^^^

error: derive(Diagnostic): wrong types for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:622:24
   |
LL |     suggestion: (Span, usize),
   |                        ^^^^^
   |
   = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`

error: derive(Diagnostic): wrong types for suggestion
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:630:17
   |
LL |     suggestion: (Span,),
   |                 ^^^^^^^
   |
   = help: `#[suggestion(...)]` on a tuple field must be applied to fields of type `(Span, Applicability)`

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:637:5
   |
LL |     #[suggestion(no_crate_suggestion)]
   |     ^

error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:644:1
   |
LL | #[multipart_suggestion(no_crate_suggestion)]
   | ^
   |
   = help: consider creating a `Subdiagnostic` instead

error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:647:1
   |
LL | #[multipart_suggestion()]
   | ^
   |
   = help: consider creating a `Subdiagnostic` instead

error: derive(Diagnostic): `#[multipart_suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:651:5
   |
LL |     #[multipart_suggestion(no_crate_suggestion)]
   |     ^
   |
   = help: consider creating a `Subdiagnostic` instead

error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:659:1
   |
LL | #[suggestion(no_crate_suggestion, code = "...")]
   | ^
   |
   = help: `#[label]` and `#[suggestion]` can only be applied to fields

error: derive(Diagnostic): `#[label]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:668:1
   |
LL | #[label]
   | ^
   |
   = help: `#[label]` and `#[suggestion]` can only be applied to fields

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:702:5
   |
LL |     #[subdiagnostic(bad)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:710:5
   |
LL |     #[subdiagnostic = "bad"]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:718:5
   |
LL |     #[subdiagnostic(bad, bad)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:726:5
   |
LL |     #[subdiagnostic("bad")]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:734:5
   |
LL |     #[subdiagnostic(eager)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:742:5
   |
LL |     #[subdiagnostic(eager)]
   |     ^

error: derive(Diagnostic): `#[subdiagnostic(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:763:5
   |
LL |     #[subdiagnostic(eager)]
   |     ^

error: derive(Diagnostic): expected at least one string literal for `code(...)`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:794:23
   |
LL |     #[suggestion(code())]
   |                       ^

error: derive(Diagnostic): `code(...)` must contain only string literals
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:802:23
   |
LL |     #[suggestion(code(foo))]
   |                       ^^^

error: derive(Diagnostic): `#[suggestion(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:826:5
   |
LL |     #[suggestion(no_crate_suggestion, code = "")]
   |     ^
   |
   = note: `#[suggestion(...)]` applied to `Vec` field is ambiguous
   = help: to show a suggestion consisting of multiple parts, use a `Subdiagnostic` annotated with `#[multipart_suggestion(...)]`
   = help: to show a variable set of suggestions, use a `Vec` of `Subdiagnostic`s annotated with `#[suggestion(...)]`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:58:8
   |
LL | #[diag = "E0123"]
   |        ^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:802:23
   |
LL |     #[suggestion(code(foo))]
   |                       ^^^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:811:25
   |
LL |     #[suggestion(code = 3)]
   |                         ^ you might be missing crate `core`

error: cannot find attribute `nonsense` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:63:3
   |
LL | #[nonsense(no_crate_example, code = E0123)]
   |   ^^^^^^^^

error: cannot find attribute `nonsense` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:150:7
   |
LL |     #[nonsense]
   |       ^^^^^^^^

error: cannot find attribute `error` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:583:3
   |
LL | #[error(no_crate_example, code = E0123)]
   |   ^^^^^

error: cannot find attribute `warn_` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:590:3
   |
LL | #[warn_(no_crate_example, code = E0123)]
   |   ^^^^^ help: a built-in attribute with a similar name exists: `warn`

error: cannot find attribute `lint` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:597:3
   |
LL | #[lint(no_crate_example, code = E0123)]
---

error[E0425]: cannot find value `nonsense` in module `crate::fluent_generated`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:75:8
   |
LL | #[diag(nonsense, code = E0123)]
   |        ^^^^^^^^ not found in `crate::fluent_generated`

error[E0425]: cannot find value `__code_34` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:808:10
   |
LL | #[derive(Diagnostic)] //~ ERROR cannot find value `__code_34` in this scope
   |          ^^^^^^^^^^ not found in this scope
   |
   = note: this error originates in the derive macro `Diagnostic` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0277]: the trait bound `Hello: IntoDiagArg` is not satisfied
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/diagnostic-derive.rs:349:12
   |
LL | #[derive(Diagnostic)]
   |          ---------- required by a bound introduced by this call
...
LL |     other: Hello,
   |            ^^^^^ the trait `IntoDiagArg` is not implemented for `Hello`
   |
   = help: the following other types implement trait `IntoDiagArg`:
             &'a T
             &'a std::path::Path
             &'a str
             &rustc_target::spec::TargetTuple
             AllocId
             AllocRange
             Backtrace
             Binder<I, T>
           and 72 others
note: required by a bound in `Diag::<'a, G>::arg`
  --> /rustc/FAKE_PREFIX/compiler/rustc_errors/src/diagnostic.rs:1310:5
   = note: this error originates in the macro `with_fn` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 85 previous errors

---
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
455   --> $DIR/subdiagnostic-derive.rs:96:9
456    |
457 LL | #[label("...")]

458    |         ^^^^^ you might be missing crate `core`
459 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
---
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
467   --> $DIR/subdiagnostic-derive.rs:582:27
468    |
469 LL |     #[suggestion_part(foo = "bar")]

470    |                           ^ you might be missing crate `core`
471 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
473   --> $DIR/subdiagnostic-derive.rs:675:28
474    |
475 LL |     #[suggestion_part(code("foo"))]

476    |                            ^^^^^ you might be missing crate `core`
477 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
479   --> $DIR/subdiagnostic-derive.rs:686:28
480    |
481 LL |     #[suggestion_part(code("foo", "bar"))]

482    |                            ^^^^^ you might be missing crate `core`
483 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
485   --> $DIR/subdiagnostic-derive.rs:697:28
486    |
487 LL |     #[suggestion_part(code(3))]

488    |                            ^ you might be missing crate `core`
489 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
491   --> $DIR/subdiagnostic-derive.rs:720:30
492    |
493 LL |     #[suggestion_part(code = 3)]

494    |                              ^ you might be missing crate `core`
495 
- error[E0433]: failed to resolve: you might be missing crate `core`
+ error[E0433]: cannot find `core` in the crate root
497   --> $DIR/subdiagnostic-derive.rs:812:48
498    |
499 LL | #[suggestion(no_crate_example, code = "", style("foo"))]


The actual stderr differed from the expected stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args session-diagnostic/subdiagnostic-derive.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/checkout/vendor" "--sysroot" "/checkout/obj/build/aarch64-unknown-linux-gnu/stage2" "--target=aarch64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "-Zwrite-long-types-to-disk=no" "-Cstrip=debuginfo" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/aarch64-unknown-linux-gnu/test/ui-fulldeps/session-diagnostic/subdiagnostic-derive" "-A" "unused" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error: derive(Diagnostic): label without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:51:1
   |
LL | #[label(no_crate_example)]
   | ^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:58:1
   |
LL | #[label]
   | ^

error: derive(Diagnostic): `#[foo]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:67:1
   |
LL | #[foo]
   | ^

error: derive(Diagnostic): `#[label = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:77:1
   |
LL | #[label = "..."]
   | ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:86:9
   |
LL | #[label(bug = "...")]
   |         ^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:86:1
   |
LL | #[label(bug = "...")]
   | ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:106:9
   |
LL | #[label(slug = 4)]
   |         ^^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:106:1
   |
LL | #[label(slug = 4)]
   | ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:116:9
   |
LL | #[label(slug("..."))]
   |         ^^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:116:1
   |
LL | #[label(slug("..."))]
   | ^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:136:1
   |
LL | #[label()]
   | ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:145:27
   |
LL | #[label(no_crate_example, code = "...")]
   |                           ^^^^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:154:27
   |
LL | #[label(no_crate_example, applicability = "machine-applicable")]
   |                           ^^^^^^^^^^^^^

error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:163:1
   |
LL | #[foo]
   | ^

error: derive(Diagnostic): `#[bar]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:177:5
   |
LL |     #[bar]
   |     ^

error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:189:5
   |
LL |     #[bar = "..."]
   |     ^

error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:201:5
   |
LL |     #[bar = 4]
   |     ^

error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:213:5
   |
LL |     #[bar("...")]
   |     ^

error: derive(Diagnostic): only `no_span` is a valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:225:13
   |
LL |     #[label(code = "...")]
   |             ^^^^

error: derive(Diagnostic): diagnostic slug must be first argument of a `#[label(...)]` attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:225:5
   |
LL |     #[label(code = "...")]
   |     ^

error: derive(Diagnostic): the `#[primary_span]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:254:5
   |
LL |     #[primary_span]
   |     ^

error: derive(Diagnostic): label without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:251:1
   |
LL | #[label(no_crate_example)]
   | ^

error: derive(Diagnostic): `#[applicability]` is only valid on suggestions
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:264:5
   |
LL |     #[applicability]
   |     ^

error: derive(Diagnostic): `#[bar]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:274:5
   |
LL |     #[bar]
   |     ^
   |
   = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes

error: derive(Diagnostic): `#[bar = ...]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:285:5
   |
LL |     #[bar = "..."]
   |     ^

error: derive(Diagnostic): `#[bar(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:296:5
   |
LL |     #[bar("...")]
   |     ^
   |
   = help: only `primary_span`, `applicability` and `skip_arg` are valid field attributes

error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:328:44
   |
LL | #[label(no_crate_example, no_crate::example)]
   |                                            ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:341:5
   |
LL |     #[primary_span]
   |     ^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:338:5
   |
LL |     #[primary_span]
   |     ^

error: derive(Diagnostic): subdiagnostic kind not specified
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:347:8
   |
LL | struct AG {
   |        ^^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:384:46
   |
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
   |                                              ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:384:32
   |
LL | #[suggestion(no_crate_example, code = "...", code = "...")]
   |                                ^^^^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:402:5
   |
---
   |
LL |     #[applicability]
   |     ^

error: derive(Diagnostic): the `#[applicability]` attribute can only be applied to fields of type `Applicability`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:412:5
   |
LL |     #[applicability]
   |     ^

error: derive(Diagnostic): suggestion without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:425:1
   |
LL | #[suggestion(no_crate_example)]
   | ^

error: derive(Diagnostic): invalid applicability
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:435:62
   |
LL | #[suggestion(no_crate_example, code = "...", applicability = "foo")]
   |                                                              ^^^^^

error: derive(Diagnostic): suggestion without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:453:1
   |
LL | #[suggestion(no_crate_example, code = "...")]
   | ^

error: derive(Diagnostic): unsupported type attribute for subdiagnostic enum
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:467:1
   |
LL | #[label]
   | ^

error: derive(Diagnostic): `var` doesn't refer to a field on this type
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:487:39
   |
LL | #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
   |                                       ^^^^^^^

error: derive(Diagnostic): `var` doesn't refer to a field on this type
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:506:43
   |
LL |     #[suggestion(no_crate_example, code = "{var}", applicability = "machine-applicable")]
   |                                           ^^^^^^^

error: derive(Diagnostic): `#[suggestion_part]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:529:5
   |
LL |     #[suggestion_part]
   |     ^
   |
   = help: `#[suggestion_part(...)]` is only valid in multipart suggestions, use `#[primary_span]` instead

error: derive(Diagnostic): `#[suggestion_part(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:532:5
   |
LL |     #[suggestion_part(code = "...")]
   |     ^
   |
   = help: `#[suggestion_part(...)]` is only valid in multipart suggestions

error: derive(Diagnostic): suggestion without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:526:1
   |
LL | #[suggestion(no_crate_example, code = "...")]
   | ^

error: derive(Diagnostic): invalid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:541:42
   |
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
   |                                          ^^^^
   |
   = help: only `no_span`, `style` and `applicability` are valid nested attributes

error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:541:1
   |
LL | #[multipart_suggestion(no_crate_example, code = "...", applicability = "machine-applicable")]
   | ^

error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:551:5
   |
LL |     #[suggestion_part]
   |     ^

error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:559:5
   |
LL |     #[suggestion_part()]
   |     ^

error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:568:5
   |
LL |     #[primary_span]
   |     ^
   |
   = help: multipart suggestions use one or more `#[suggestion_part]`s rather than one `#[primary_span]`

error: derive(Diagnostic): multipart suggestion without any `#[suggestion_part(...)]` fields
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:565:1
   |
LL | #[multipart_suggestion(no_crate_example)]
   | ^

error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:576:5
   |
LL |     #[suggestion_part]
   |     ^

error: derive(Diagnostic): `#[suggestion_part(...)]` attribute without `code = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:579:5
   |
LL |     #[suggestion_part()]
   |     ^

error: derive(Diagnostic): `code` is the only valid nested attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:582:23
   |
LL |     #[suggestion_part(foo = "bar")]
   |                       ^^^

error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:587:5
   |
LL |     #[suggestion_part(code = "...")]
   |     ^

error: derive(Diagnostic): the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:590:5
   |
LL |     #[suggestion_part()]
   |     ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:598:37
   |
LL |     #[suggestion_part(code = "...", code = ",,,")]
   |                                     ^^^^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:598:23
   |
LL |     #[suggestion_part(code = "...", code = ",,,")]
   |                       ^^^^

error: derive(Diagnostic): `#[applicability]` has no effect if all `#[suggestion]`/`#[multipart_suggestion]` attributes have a static `applicability = "..."`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:627:5
   |
LL |     #[applicability]
   |     ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:675:34
   |
LL |     #[suggestion_part(code("foo"))]
   |                                  ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:686:41
   |
LL |     #[suggestion_part(code("foo", "bar"))]
   |                                         ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:697:30
   |
LL |     #[suggestion_part(code(3))]
   |                              ^

error: derive(Diagnostic): expected exactly one string literal for `code = ...`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:708:29
   |
LL |     #[suggestion_part(code())]
   |                             ^

error: derive(Diagnostic): attribute specified multiple times
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:763:1
   |
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
   | ^
   |
note: previously specified here
  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:763:1
   |
LL | #[suggestion(no_crate_example, code = "", style = "hidden", style = "normal")]
   | ^

error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:772:1
   |
LL | #[suggestion_hidden(no_crate_example, code = "")]
   | ^
   |
   = help: Use `#[suggestion(..., style = "hidden")]` instead

error: derive(Diagnostic): `#[suggestion_hidden(...)]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:780:1
   |
LL | #[suggestion_hidden(no_crate_example, code = "", style = "normal")]
   | ^
   |
   = help: Use `#[suggestion(..., style = "hidden")]` instead

error: derive(Diagnostic): invalid suggestion style
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:788:51
   |
LL | #[suggestion(no_crate_example, code = "", style = "foo")]
   |                                                   ^^^^^
   |
   = help: valid styles are `normal`, `short`, `hidden`, `verbose` and `tool-only`

error: derive(Diagnostic): expected `= "xxx"`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:796:49
   |
LL | #[suggestion(no_crate_example, code = "", style = 42)]
   |                                                 ^

error: derive(Diagnostic): a diagnostic slug must be the first argument to the attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:804:48
   |
LL | #[suggestion(no_crate_example, code = "", style)]
   |                                                ^

error: derive(Diagnostic): expected `= "xxx"`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:812:48
   |
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
   |                                                ^

error: derive(Diagnostic): `#[primary_span]` is not a valid attribute
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:825:5
   |
LL |     #[primary_span]
   |     ^
   |
   = note: there must be exactly one primary span
   = help: to create a suggestion with multiple spans, use `#[multipart_suggestion]` instead

error: derive(Diagnostic): suggestion without `#[primary_span]` field
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:822:1
   |
LL | #[suggestion(no_crate_example, code = "")]
   | ^

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:96:9
   |
LL | #[label("...")]
   |         ^^^^^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:312:1
   |
LL | union AC {
   | ^^^^^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:582:27
   |
LL |     #[suggestion_part(foo = "bar")]
   |                           ^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:675:28
   |
LL |     #[suggestion_part(code("foo"))]
   |                            ^^^^^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:686:28
   |
LL |     #[suggestion_part(code("foo", "bar"))]
   |                            ^^^^^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:697:28
   |
LL |     #[suggestion_part(code(3))]
   |                            ^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:720:30
   |
LL |     #[suggestion_part(code = 3)]
   |                              ^ you might be missing crate `core`

error[E0433]: cannot find `core` in the crate root
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:812:48
   |
LL | #[suggestion(no_crate_example, code = "", style("foo"))]
   |                                                ^ you might be missing crate `core`

error: cannot find attribute `foo` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:67:3
   |
LL | #[foo]
---

error: cannot find attribute `bar` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:213:7
   |
LL |     #[bar("...")]
   |       ^^^

error: cannot find attribute `bar` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:274:7
   |
---

error: cannot find attribute `bar` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:296:7
   |
LL |     #[bar("...")]
   |       ^^^

error[E0425]: cannot find value `slug` in module `crate::fluent_generated`
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:126:9
   |
LL | #[label(slug)]
   |         ^^^^ not found in `crate::fluent_generated`

error[E0425]: cannot find value `__code_29` in this scope
##[error]  --> /checkout/tests/ui-fulldeps/session-diagnostic/subdiagnostic-derive.rs:714:10
   |
LL | #[derive(Subdiagnostic)]
   |          ^^^^^^^^^^^^^ not found in this scope
   |

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants